package com.zuowei.ycy.user.adapter;

import android.content.Context;
import android.view.View;

import com.and.yzy.frame.adapter.CommonAdapter;
import com.and.yzy.frame.adapter.ViewHolder;
import com.zuowei.ycy.R;
import com.zuowei.ycy.user.domain.BusinessSortInfo;

import java.util.List;

/**
 * 外卖订单已选列表
 */
public class OrderCommitAdapter extends CommonAdapter<BusinessSortInfo> {
    public OrderCommitAdapter(Context context, List<BusinessSortInfo> mList, int itemLayoutId) {
        super(context, mList, itemLayoutId);
    }

    @Override
    public void convert(ViewHolder holder, BusinessSortInfo item, int positon) {

        holder.setTextViewText(R.id.tv_name,item.getGoods_name())
                .setTextViewText(R.id.tv_number,"x"+item.getNumber())
                .setTextViewText(R.id.tv_price,"￥"+item.getGoods_price());

        if (positon==getCount()-1){
            holder.setViewVisibility(R.id.v_divier, View.INVISIBLE);
        }else {
            holder.setViewVisibility(R.id.v_divier, View.VISIBLE);
        }
    }
}
